﻿using Currency.Infra.Repository.Entities.Config;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using User.Entity.Entities;

namespace User.Entity.Config
{
    /// <summary>
    /// UserInfo映射
    /// </summary>
    public class UserInfoConfig: EntityTypeConfiguration<UserInfo>
    {
        public override void Configure(EntityTypeBuilder<UserInfo> builder)
        {
            base.Configure(builder);
            builder.Property(x => x.UserName).HasMaxLength(32).HasColumnType("varchar(32)");
            builder.Property(x => x.Account).IsRequired().HasMaxLength(32).HasColumnType("varchar(32)");
            builder.Property(x => x.Salt).HasMaxLength(32).HasColumnType("varchar(32)");
            builder.Property(x => x.Password).HasMaxLength(32).HasColumnType("varchar(32)");
            builder.Property(x => x.CreateTime).HasColumnType("datetime");
            builder.ToTable("UserInfo");
        }
    }
}
